package com.taotao.delayjob.example.util;

import java.util.Random;

/**
 * 随机数工具类
 *
 * @author fanbeibei
 * @since 2019-02-22
 */
public class RandomUtil {
    private RandomUtil(){}


    /**
     * 产生随机数字
     *
     * @param c 位数
     *
     * @return
     */
    public static String generateRandomNum(int c){
        Random random = new Random();
        StringBuilder result= new StringBuilder();
        for (int i=0;i<c;i++)
        {
            result.append(random.nextInt(10)) ;
        }

        return result.toString();
    }
}
